﻿@model IEnumerable<LotteryVoteMVC.Models.LotteryCompany>
@using LotteryVoteMVC.Core.Application
@using LotteryVoteMVC.Models
@using LotteryVoteMVC.Resources
@using LotteryVoteMVC.Utility
@{
    ViewBag.Title = @Resource.Zodiac;
    Layout = "~/Views/Shared/BetMain.cshtml";
}
@section Head
{
    <script src="@Url.Content("~/Scripts/Customer/BetZodiac.js")?v=1.1" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/Zodiac.css")" rel="stylesheet" type="text/css" />
}
@{
    Func<AutoBetType, PlayWay, string> GetWagerName = (bt, pw) =>
    {
        return string.Format("wager_{0}_{1}", (int)bt, (int)pw);
    };
}
<div style="width: 100%; overflow: hidden">
    <div id="left">
        <table cellpadding="0" cellspacing="0" class="oddTable">
            <thead>
                <tr>
                    <td class="even">
                        @Resource.VietnameseZodiac
                    </td>
                </tr>
            </thead>
            <tbody>
                <tr class="whiteSd">
                    <td style="height: 60px">
                    </td>
                </tr>
                @for (int i = 0; i < LotterySystem.Current.TwelveZodiac.Length / 8 + 1; i++)
                {
                    <tr>
                        <td class="odd">
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @for (int j = i * 8; j < i * 8 + 8 && j < LotterySystem.Current.TwelveZodiac.Length; j++)
                            {
                                <span class="betNum">@LotterySystem.Current.TwelveZodiac[j].ToString("D2")</span>
                            }
                        </td>
                    </tr>
                }
                <tr>
                    <td class="odd">
                        @foreach (var company in Model)
                        {
                            <input type="checkbox" id='@(company.CompanyId)_@((int)AutoBetType.TwelveZodiac)'
                                company='@company.CompanyId' class='Company_@(AutoBetType.TwelveZodiac)' />
                            <label for='@(company.CompanyId)_@((int)AutoBetType.TwelveZodiac)'>
                                @company.Abbreviation</label>
                        }
                    </td>
                </tr>
                <tr>
                    <td>
                        <table cellpadding="0" cellspacing="0" class="innerTable">
                            <tr>
                                <td>
                                    @Resource.Head
                                </td>
                                <td>
                                    @Resource.Last
                                </td>
                                <td>
                                    @Resource.HeadAndLast
                                </td>
                                <td>
                                    @Resource.Roll
                                </td>
                                <td>
                                    @Resource.Amount
                                </td>
                            </tr>
                            <tr>
                                <td class="odd">
                                    <input type="text" id='@GetWagerName(AutoBetType.TwelveZodiac, PlayWay.Head)_Head'
                                            class='@AutoBetType.TwelveZodiac' />
                                </td>
                                <td class="odd">
                                    <input type="text" id='@GetWagerName(AutoBetType.TwelveZodiac, PlayWay.Last)_Last'
                                            class='@AutoBetType.TwelveZodiac' />
                                </td>
                                <td class="odd">
                                    <input type="text" id='@GetWagerName(AutoBetType.TwelveZodiac, PlayWay.HeadAndLast)_HeadAndLast'
                                            class='@AutoBetType.TwelveZodiac' />
                                </td>
                                <td class="odd">
                                    <input type="text" id='@GetWagerName(AutoBetType.TwelveZodiac, PlayWay.Roll)_Roll'
                                            class='@AutoBetType.TwelveZodiac' />
                                </td>
                                <td class="odd">
                                    <span id='@AutoBetType.TwelveZodiac' class="turnover"></span>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div id="right">
        <div>
            <table cellpadding="0" cellspacing="0" style="width: 50%; float: left">
                <thead>
                    <tr>
                        <td class="even">
                            @Resource.OddEven
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    @for (int i = 0; i < LotterySystem.Current.OddEven.Length / 5; i++)
                    {
                        <tr>
                            <td class='@(i % 2 == 0 ? "odd" : "")'>
                                @for (int j = i * 5; j < i * 5 + 5 && j < LotterySystem.Current.OddEven.Length; j++)
                                {
                                    <span class="betNum">
                                        @LotterySystem.Current.OddEven[j]</span>
                                }
                            </td>
                        </tr>
                    }
                    <tr>
                        <td>
                            @foreach (var company in Model)
                            {
                                <input type="checkbox" id='@(company.CompanyId)_@((int)AutoBetType.OddEven)'
                                    company='@(company.CompanyId)' class='Company_@(AutoBetType.OddEven)' />
                                <label for='@(company.CompanyId)_@((int)AutoBetType.OddEven)'>
                                    @company.Abbreviation</label>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellpadding="0" cellspacing="0" class="innerTable">
                                <tr>
                                    <td class="odd">
                                        @Resource.Head
                                    </td>
                                    <td class="odd">
                                        @Resource.Last
                                    </td>
                                    <td class="odd">
                                        @Resource.HeadAndLast
                                    </td>
                                    <td class="odd">
                                        @Resource.Roll
                                    </td>
                                    <td class="odd">
                                        @Resource.Amount
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddEven, PlayWay.Head)_Head'
                                                class='@AutoBetType.OddEven' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddEven, PlayWay.Last)_Last'
                                                class='@AutoBetType.OddEven' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddEven, PlayWay.HeadAndLast)_HeadAndLast'
                                                class='@AutoBetType.OddEven' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddEven, PlayWay.Roll)_Roll'
                                                class='@AutoBetType.OddEven' />
                                    </td>
                                    <td>
                                        <span id='@AutoBetType.OddEven' class="turnover"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellpadding="0" cellspacing="0" style="width: 50%">
                <thead>
                    <tr>
                        <td class="even">
                            @Resource.EvenOdd
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    @for (int i = 0; i < LotterySystem.Current.EvenOdd.Length / 5; i++)
                    {
                        <tr>
                            <td class='@(i % 2 == 0 ? "odd" : "")'>
                                @for (int j = i * 5; j < i * 5 + 5 && j < LotterySystem.Current.EvenOdd.Length; j++)
                                {
                                    <span class="betNum">
                                        @LotterySystem.Current.EvenOdd[j].ToString("D2")</span>
                                }
                            </td>
                        </tr>
                    }
                    <tr>
                        <td>
                            @foreach (var company in Model)
                            {
                                <input type="checkbox" id='@(company.CompanyId)_@((int)AutoBetType.EvenOdd)'
                                    company='@company.CompanyId' class='Company_@(AutoBetType.EvenOdd)' />
                                <label for='@(company.CompanyId)_@((int)AutoBetType.EvenOdd)'>
                                    @company.Abbreviation</label>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellpadding="0" cellspacing="0" class="innerTable">
                                <tr>
                                    <td class="odd">
                                        @Resource.Head
                                    </td>
                                    <td class="odd">
                                        @Resource.Last
                                    </td>
                                    <td class="odd">
                                        @Resource.HeadAndLast
                                    </td>
                                    <td class="odd">@Resource.Roll
                                    </td>
                                    <td class="odd">
                                        @Resource.Amount
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenOdd, PlayWay.Head)_Head'
                                                class='@AutoBetType.EvenOdd' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenOdd, PlayWay.Last)_Last'
                                                class='@AutoBetType.EvenOdd' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenOdd, PlayWay.HeadAndLast)_HeadAndLast'
                                                class='@AutoBetType.EvenOdd' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenOdd, PlayWay.Roll)_Roll'
                                                class='@AutoBetType.EvenOdd' />
                                    </td>
                                    <td>
                                        <span id='@AutoBetType.EvenOdd' class="turnover"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div>
            <table cellpadding="0" cellspacing="0" style="width: 50%; float: left">
                <thead>
                    <tr>
                        <td class="even">
                            @Resource.OddOdd
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    @for (int i = 0; i < LotterySystem.Current.OddOdd.Length / 5; i++)
                    {
                        <tr>
                            <td class='@(i % 2 == 0 ? "odd" : "")'>
                                @for (int j = i * 5; j < i * 5 + 5 && j < LotterySystem.Current.OddOdd.Length; j++)
                                {
                                    <span class="betNum">
                                        @LotterySystem.Current.OddOdd[j].ToString("D2")</span>
                                }
                            </td>
                        </tr>
                    }
                    <tr>
                        <td>
                            @foreach (var company in Model)
                            {
                                <input type="checkbox" id='@(company.CompanyId)_@((int)AutoBetType.OddOdd)'
                                    company='@company.CompanyId' class='Company_@(AutoBetType.OddOdd)' />
                                <label for='@(company.CompanyId)_@((int)AutoBetType.OddOdd)'>
                                    @company.Abbreviation</label>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellpadding="0" cellspacing="0" class="innerTable">
                                <tr>
                                    <td class="odd">
                                        @Resource.Head
                                    </td>
                                    <td class="odd">
                                        @Resource.Last
                                    </td>
                                    <td class="odd">
                                        @Resource.HeadAndLast
                                    </td>
                                    <td class="odd">@Resource.Roll
                                    </td>
                                    <td class="odd">
                                        @Resource.Amount
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddOdd, PlayWay.Head)_Head'
                                                class='@AutoBetType.OddOdd' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddOdd, PlayWay.Last)_Last'
                                                class='@AutoBetType.OddOdd' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddOdd, PlayWay.HeadAndLast)_HeadAndLast'
                                                class='@AutoBetType.OddOdd' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.OddOdd, PlayWay.Roll)_Roll'
                                                class='@AutoBetType.OddOdd' />
                                    </td>
                                    <td>
                                        <span id='@AutoBetType.OddOdd' class="turnover"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellpadding="0" cellspacing="0" style="width: 50%">
                <thead>
                    <tr>
                        <td class="even">
                            @Resource.EvenEven
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    @for (int i = 0; i < LotterySystem.Current.EvenEven.Length / 5; i++)
                    {
                        <tr>
                            <td class='@(i % 2 == 0 ? "odd" : "")'>
                                @for (int j = i * 5; j < i * 5 + 5 && j < LotterySystem.Current.EvenEven.Length; j++)
                                {
                                    <span class="betNum">
                                        @LotterySystem.Current.EvenEven[j].ToString("D2")</span>
                                }
                            </td>
                        </tr>
                    }
                    <tr>
                        <td>
                            @foreach (var company in Model)
                            {
                                <input type="checkbox" id='@(company.CompanyId)_@((int)AutoBetType.EvenEven)'
                                    company='@company.CompanyId' class='Company_@(AutoBetType.EvenEven)' />
                                <label for='@(company.CompanyId)_@((int)AutoBetType.EvenEven)'>
                                    @company.Abbreviation</label>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellpadding="0" cellspacing="0" class="innerTable">
                                <tr>
                                    <td class="odd">
                                        @Resource.Head
                                    </td>
                                    <td class="odd">
                                        @Resource.Last
                                    </td>
                                    <td class="odd">
                                        @Resource.HeadAndLast
                                    </td>
                                    <td class="odd">
                                        @Resource.Roll
                                    </td>
                                    <td class="odd">
                                        @Resource.Amount
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenEven, PlayWay.Head)_Head'
                                                class='@AutoBetType.EvenEven' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenEven, PlayWay.Last)_Last'
                                                class='@AutoBetType.EvenEven' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenEven, PlayWay.HeadAndLast)_HeadAndLast'
                                                class='@AutoBetType.EvenEven' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.EvenEven, PlayWay.Roll)_Roll'
                                                class='@AutoBetType.EvenEven' />
                                    </td>
                                    <td>
                                        <span id='@AutoBetType.EvenEven' class="turnover"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div>
            <table cellpadding="0" cellspacing="0" style="width: 50%; float: left">
                <thead>
                    <tr>
                        <td class="even">
                            @Resource.Small
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    @for (int i = 0; i < LotterySystem.Current.Small.Length / 5; i++)
                    {
                        <tr>
                            <td class='@(i % 2 == 0 ? "odd" : "")'>
                                @for (int j = i * 5; j < i * 5 + 5 && j < LotterySystem.Current.Small.Length; j++)
                                {
                                    <span class="betNum">
                                        @LotterySystem.Current.Small[j].ToString("D2")</span>
                                }
                            </td>
                        </tr>
                    }
                    <tr>
                        <td>
                            @foreach (var company in Model)
                            {
                                <input type="checkbox" id='@(company.CompanyId)_@((int)AutoBetType.Small)'
                                    company='@company.CompanyId' class='Company_@(AutoBetType.Small)' />
                                <label for='@(company.CompanyId)_@((int)AutoBetType.Small)'>
                                    @company.Abbreviation</label>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellpadding="0" cellspacing="0" class="innerTable">
                                <tr>
                                    <td class="odd">
                                        @Resource.Head
                                    </td>
                                    <td class="odd">
                                        @Resource.Last
                                    </td>
                                    <td class="odd">
                                        @Resource.HeadAndLast
                                    </td>
                                    <td class="odd">@Resource.Roll
                                    </td>
                                    <td class="odd">
                                        @Resource.Amount
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Small, PlayWay.Head)_Head'
                                                class='@AutoBetType.Small' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Small, PlayWay.Last)_Last'
                                                class='@AutoBetType.Small' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Small, PlayWay.HeadAndLast)_HeadAndLast'
                                                class='@AutoBetType.Small' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Small, PlayWay.Roll)_Roll'
                                                class='@AutoBetType.Small' />
                                    </td>
                                    <td>
                                        <span id='@AutoBetType.Small' class="turnover"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table cellpadding="0" cellspacing="0" style="width: 50%">
                <thead>
                    <tr>
                        <td class="even">
                            @Resource.Big
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>
                        </td>
                    </tr>
                    @for (int i = 0; i < LotterySystem.Current.Big.Length / 5; i++)
                    {
                        <tr>
                            <td class='@(i % 2 == 0 ? "odd" : "")'>
                                @for (int j = i * 5; j < i * 5 + 5 && j < LotterySystem.Current.Big.Length; j++)
                                {
                                    <span class="betNum">
                                        @LotterySystem.Current.Big[j].ToString("D2")</span>
                                }
                            </td>
                        </tr>
                    }
                    <tr>
                        <td>
                            @foreach (var company in Model)
                            {
                                <input type="checkbox" id='@(company.CompanyId)_@((int)AutoBetType.Big)'
                                    company='@company.CompanyId' class='Company_@(AutoBetType.Big)' />
                                <label for='@(company.CompanyId)_@((int)AutoBetType.Big)'>
                                    @company.Abbreviation</label>
                            }
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table cellpadding="0" cellspacing="0" class="innerTable">
                                <tr>
                                    <td class="odd">
                                        @Resource.Head
                                    </td>
                                    <td class="odd">
                                        @Resource.Last
                                    </td>
                                    <td class="odd">
                                        @Resource.HeadAndLast
                                    </td>
                                    <td class="odd">
                                        @Resource.Roll
                                    </td>
                                    <td class="odd">
                                        @Resource.Amount
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Big, PlayWay.Head)_Head'
                                                class='@AutoBetType.Big' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Big, PlayWay.Last)_Last'
                                                class='@AutoBetType.Big' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Big, PlayWay.HeadAndLast)_HeadAndLast'
                                                class='@AutoBetType.Big' />
                                    </td>
                                    <td>
                                        <input type="text" id='@GetWagerName(AutoBetType.Big, PlayWay.Roll)_Roll'
                                                class='@AutoBetType.Big' />
                                    </td>
                                    <td>
                                        <span id='@AutoBetType.Big' class="turnover"></span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
